﻿using DXApplicationTangche.UC.面料审核.Service;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DXApplicationTangche.UC.金蝶.dto
{
    class StockOutDTO
    {
        public class FBillTypeID
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNUMBER { get; set; }
            public FBillTypeID(String FBillTypeID)
            {
                this.FNUMBER = FBillTypeID;
            }
        }

        public class FCustId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FDeptId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
            public FDeptId(String FDeptId)
            {
                this.FNumber = FDeptId;
            }
        }

        public class FPickerId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FStaffNumber { get; set; }
        }

        public class FStockerId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FStockerGroupId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FOwnerIdHead
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FBaseCurrId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FMaterialId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
            public FMaterialId(String FMaterialId)
            {
                this.FNumber = FMaterialId;
            }
            public FMaterialId()
            {

            }
        }

        public class FAuxPropId
        {
        }

        public class FUnitID
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FBaseUnitId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FStockId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FSTOCKLOCID__FF100001
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FStockLocId
        {
            /// <summary>
            /// 
            /// </summary>
            public FSTOCKLOCID__FF100001 FSTOCKLOCID__FF100001 { get; set; }
        }

        public class FLot
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FPRODUCTGROUPID
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNUMBER { get; set; }
        }

        public class FOwnerId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FBomId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FStockStatusId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FCostItem
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNUMBER { get; set; }
        }

        public class FKeeperId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FExtAuxUnitId
        {
            /// <summary>
            /// 
            /// </summary>
            public string FNumber { get; set; }
        }

        public class FSerialSubEntityItem
        {
            /// <summary>
            /// 
            /// </summary>
            public int FDetailID { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FSerialNo { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FSerialNote { get; set; }
        }

        public class FEntityItem
        {
            /// <summary>
            /// 
            /// </summary>
            public int FEntryID { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FMaterialId FMaterialId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FAuxPropId FAuxPropId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FUnitID FUnitID { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public Double FQty { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FBaseUnitId FBaseUnitId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FStockId FStockId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FStockLocId FStockLocId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FLot FLot { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FOwnerTypeId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FPRODUCTGROUPID FPRODUCTGROUPID { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FOwnerId FOwnerId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FBomId FBomId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FEntryNote { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FProjectNo { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FProduceDate { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FServiceContext { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FStockStatusId FStockStatusId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FMtoNo { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FCostItem FCostItem { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FKeeperTypeId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FDistribution { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FKeeperId FKeeperId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FExtAuxUnitId FExtAuxUnitId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public int FExtAuxUnitQty { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public List<FSerialSubEntityItem> FSerialSubEntity { get; set; }
            public FEntityItem(Double FQty,String FMaterialId)
            {
                this.FQty = FQty;
                this.FMaterialId = new FMaterialId();
                this.FMaterialId.FNumber = FMaterialId;
            }
        }

        public class Model
        {
            /// <summary>
            /// 
            /// </summary>
            public String FID { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FBillNo { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FBillTypeID FBillTypeID { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FStockDirect { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FDate { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FCustId FCustId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FDeptId FDeptId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FPickerId FPickerId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FStockerId FStockerId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FStockerGroupId FStockerGroupId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FBizType { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FOwnerTypeIdHead { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public FOwnerIdHead FOwnerIdHead { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FNote { get; set; } 

            /// <summary>
            /// 
            /// </summary>
            public FBaseCurrId FBaseCurrId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string FScanBox { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public List<FEntityItem> FEntity { get; set; }
            public Model(String FBizType,String FBillTypeID,String FDeptId, String FMaterialId,Double FQty)
            {
                this.FBizType = FBizType;
                this.FBillTypeID = new FBillTypeID(FBillTypeID);
                this.FDeptId = new FDeptId(FDeptId);

                this.FEntity = new List<FEntityItem>();
                this.FEntity.Add(new FEntityItem(FQty, FMaterialId));
            }
            public Model(String FBizType, String FBillTypeID, String FDeptId,List<StockOutDetailDTO> stockOutDetailDTOs)
            {
                this.FBizType = FBizType;
                this.FBillTypeID = new FBillTypeID(FBillTypeID);
                this.FDeptId = new FDeptId(FDeptId);

                this.FEntity = new List<FEntityItem>();
                foreach (StockOutDetailDTO stockOutDetailDTO in stockOutDetailDTOs)
                {
                    this.FEntity.Add(new FEntityItem(stockOutDetailDTO.FQty, stockOutDetailDTO.MaterialChildId));
                }
            }
        }

        public class StockOutRoot
        {
            private List<StockOutDetailDTO> stockOutChildDTOs;

            /// <summary>
            /// 
            /// </summary>
            public List<string> NeedUpDateFields { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public List<string> NeedReturnFields { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string IsDeleteEntry { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string SubSystemId { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string IsVerifyBaseDataField { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string IsEntryBatchFill { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string ValidateFlag { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string NumberSearch { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string IsAutoAdjustField { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string InterationFlags { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public string IgnoreInterationFlag { get; set; }
            /// <summary>
            /// 
            /// </summary>
            public Model Model { get; set; }
            
            public StockOutRoot(List<StockOutDetailDTO> stockOutDetailDTOs)
            {
                this.Model = new Model("物料领用", "QTCKD01_SYS", "100303", stockOutDetailDTOs);
            }

        }
        public class StockOutChildDTO
        {
            //物料fnumber
            public String MaterialChildId { get; set; }
            //采购数量
            public Double FQty { get; set; }
            public StockOutChildDTO(String MaterialChildId, Double FQty)
            {
                this.MaterialChildId = MaterialChildId;
                this.FQty = FQty;
            }
            public StockOutChildDTO()
            {

            }
        }
        
    }
}
